﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using MySql.Data.MySqlClient;
using System.Text;

/// <summary>
///VideoDAL 的摘要说明
/// </summary>
public class VideoDAL
{
	public VideoDAL()
	{
		//
		//TODO: 在此处添加构造函数逻辑
		//        
	}

    public DataTable GeteData(int id, int count)
    {
        MySqlDataAdapter adapter = null;
        string sql = "select vid,title,createtime,remotepic from  ccvms_video where cid=" + id + " and status>-1  order by vid desc limit 0 ," + count;
        adapter = new MySqlDataAdapter(sql, DBManager.CCVMS);
        DataTable tb = new DataTable();
        adapter.Fill(tb);
        return tb;
    }

    public DataTable GeteData(int count)
    {
        MySqlDataAdapter adapter = null;
        string sql = "select vid,title,createtime,remotepic from  ccvms_video where status>-1 order by vid desc limit 0 ," + count;
        adapter = new MySqlDataAdapter(sql, DBManager.CCVMS);
        DataTable tb = new DataTable();
        //adapter.Fill(tb);
        return tb;
    }

    public DataTable GetDataByVid(int vid)
    {
        MySqlDataAdapter ad = null;
        string sql = "select vid,title,createtime,remotepic,description,viewcount from  ccvms_video where vid=" + vid;
        ad = new MySqlDataAdapter(sql, DBManager.CCVMS);
        DataTable tb = new DataTable();
        ad.Fill(tb);
        return tb;
    }
}